\hypertarget{class_state}{
\section{State Class Reference}
\label{class_state}\index{State@{State}}
}


{\ttfamily \#include $<$State.hpp$>$}

Inheritance diagram for State:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=11.000000cm]{class_state}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_state_ab91bb1dd5aa6260ab2a456581daf9ec2}{State} ()
\item 
virtual \hyperlink{class_state_afab438d92b90dc18d194dbd9c9c8bab3}{$\sim$State} ()
\item 
const std::map$<$ \hyperlink{class_state_done_code}{StateDoneCode}, \hyperlink{class_state}{State} $\ast$ $>$ \& \hyperlink{class_state_a92b5cea13d0979711a1e9d364b101090}{GetTransitions} ()
\item 
void \hyperlink{class_state_ac7048d46adbba2594bac21ed28f5b688}{AddTransition} (\hyperlink{class_state}{State} \&state)
\item 
void \hyperlink{class_state_a386cc0be3fd5f6f0bdd6762fb7241440}{AddTransition} (\hyperlink{class_state_done_code}{StateDoneCode} doneCode, \hyperlink{class_state}{State} \&state)
\item 
void \hyperlink{class_state_affc91f3b2042c17937831e72987c18c4}{RemoveTransition} (\hyperlink{class_state_done_code}{StateDoneCode} doneCode)
\item 
\hyperlink{class_state_done_code}{StateDoneCode} \hyperlink{class_state_a9039982e4062751c0f8980e7f27a6843}{GetDoneCode} ()
\item 
\hyperlink{class_state}{State} \& \hyperlink{class_state_a9826f43ac54827729f7c153b5d064597}{GetNextState} ()
\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{class_state_a3a160d410512e0f4529210aa8e1d9117}{HandleActivate} ()
\item 
virtual void \hyperlink{class_state_a29e67195da90c4c44e0e8f0fbe938c7c}{HandlePeriodic} ()
\item 
virtual void \hyperlink{class_state_a8fd757a8c9b92a4387c37657644498cf}{HandleContinuous} ()
\item 
void \hyperlink{class_state_afc24d1a3d56c4d41fe85329e372f2146}{SetDoneCode} (\hyperlink{class_state_done_code}{StateDoneCode} doneCode)
\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_state_a51513aeb7810ced3badc7064adfc7d9d}{
class \hyperlink{class_state_a51513aeb7810ced3badc7064adfc7d9d}{StateMachineController}}
\label{class_state_a51513aeb7810ced3badc7064adfc7d9d}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
The \hyperlink{class_state}{State} class is used by the \hyperlink{class_state_machine_controller}{StateMachineController}.

The \hyperlink{class_state}{State} class is the base class for states in the state machine in \hyperlink{class_state_machine_controller}{StateMachineController}. States stores a transition map that maps a \hyperlink{class_state_done_code}{StateDoneCode} to another \hyperlink{class_state}{State}. When the state is done, it sets the \char`\"{}done code\char`\"{}. When the done code is set, the state machine moves on to the \hyperlink{class_state}{State} specified by the transition map.

This class seems to work. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_state_ab91bb1dd5aa6260ab2a456581daf9ec2}{
\index{State@{State}!State@{State}}
\index{State@{State}!State@{State}}
\subsubsection[{State}]{\setlength{\rightskip}{0pt plus 5cm}State::State (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_state_ab91bb1dd5aa6260ab2a456581daf9ec2}
Constructor for \hyperlink{class_state}{State}. \hypertarget{class_state_afab438d92b90dc18d194dbd9c9c8bab3}{
\index{State@{State}!$\sim$State@{$\sim$State}}
\index{$\sim$State@{$\sim$State}!State@{State}}
\subsubsection[{$\sim$State}]{\setlength{\rightskip}{0pt plus 5cm}State::$\sim$State (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{class_state_afab438d92b90dc18d194dbd9c9c8bab3}
Desturctor for \hyperlink{class_state}{State}. 

\subsection{Member Function Documentation}
\hypertarget{class_state_ac7048d46adbba2594bac21ed28f5b688}{
\index{State@{State}!AddTransition@{AddTransition}}
\index{AddTransition@{AddTransition}!State@{State}}
\subsubsection[{AddTransition}]{\setlength{\rightskip}{0pt plus 5cm}void State::AddTransition (
\begin{DoxyParamCaption}
\item[{{\bf State} \&}]{state}
\end{DoxyParamCaption}
)}}
\label{class_state_ac7048d46adbba2594bac21ed28f5b688}
Adds a transition that specifies which state to transition if the state finishes successfully.


\begin{DoxyParams}{Parameters}
{\em state} & The \hyperlink{class_state}{State} to transition to. \\
\hline
\end{DoxyParams}
\hypertarget{class_state_a386cc0be3fd5f6f0bdd6762fb7241440}{
\index{State@{State}!AddTransition@{AddTransition}}
\index{AddTransition@{AddTransition}!State@{State}}
\subsubsection[{AddTransition}]{\setlength{\rightskip}{0pt plus 5cm}void State::AddTransition (
\begin{DoxyParamCaption}
\item[{{\bf StateDoneCode}}]{doneCode, }
\item[{{\bf State} \&}]{state}
\end{DoxyParamCaption}
)}}
\label{class_state_a386cc0be3fd5f6f0bdd6762fb7241440}
Adds a transition that specifies which state to transition if the state finishes with the specified DoneCode.


\begin{DoxyParams}{Parameters}
{\em doneCode} & The DoneCode for the transition. \\
\hline
{\em state} & The \hyperlink{class_state}{State} to transition to. \\
\hline
\end{DoxyParams}
\hypertarget{class_state_a9039982e4062751c0f8980e7f27a6843}{
\index{State@{State}!GetDoneCode@{GetDoneCode}}
\index{GetDoneCode@{GetDoneCode}!State@{State}}
\subsubsection[{GetDoneCode}]{\setlength{\rightskip}{0pt plus 5cm}{\bf StateDoneCode} State::GetDoneCode (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_state_a9039982e4062751c0f8980e7f27a6843}
Gets the State's \hyperlink{class_state_done_code}{StateDoneCode}.

If the \hyperlink{class_state}{State} is not done, it returns StateDoneCode::GetNotDoneCode().

\begin{DoxyReturn}{Returns}
The \hyperlink{class_state_done_code}{StateDoneCode}. 
\end{DoxyReturn}
\hypertarget{class_state_a9826f43ac54827729f7c153b5d064597}{
\index{State@{State}!GetNextState@{GetNextState}}
\index{GetNextState@{GetNextState}!State@{State}}
\subsubsection[{GetNextState}]{\setlength{\rightskip}{0pt plus 5cm}{\bf State} \& State::GetNextState (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_state_a9826f43ac54827729f7c153b5d064597}
Gets the next \hyperlink{class_state}{State}.

If the \hyperlink{class_state}{State} is not done, it returns itself.

\begin{DoxyReturn}{Returns}
The next \hyperlink{class_state}{State}. 
\end{DoxyReturn}
\hypertarget{class_state_a92b5cea13d0979711a1e9d364b101090}{
\index{State@{State}!GetTransitions@{GetTransitions}}
\index{GetTransitions@{GetTransitions}!State@{State}}
\subsubsection[{GetTransitions}]{\setlength{\rightskip}{0pt plus 5cm}const map$<$ {\bf StateDoneCode}, {\bf State} $\ast$ $>$ \& State::GetTransitions (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_state_a92b5cea13d0979711a1e9d364b101090}
Returns the transitions map that maps a done code to a state.

\begin{DoxyReturn}{Returns}
The transition map that maps a done code to a state. 
\end{DoxyReturn}
\hypertarget{class_state_a3a160d410512e0f4529210aa8e1d9117}{
\index{State@{State}!HandleActivate@{HandleActivate}}
\index{HandleActivate@{HandleActivate}!State@{State}}
\subsubsection[{HandleActivate}]{\setlength{\rightskip}{0pt plus 5cm}void State::HandleActivate (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}protected, virtual\mbox{]}}}}
\label{class_state_a3a160d410512e0f4529210aa8e1d9117}
Runs when the state is first run. \hypertarget{class_state_a8fd757a8c9b92a4387c37657644498cf}{
\index{State@{State}!HandleContinuous@{HandleContinuous}}
\index{HandleContinuous@{HandleContinuous}!State@{State}}
\subsubsection[{HandleContinuous}]{\setlength{\rightskip}{0pt plus 5cm}void State::HandleContinuous (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}protected, virtual\mbox{]}}}}
\label{class_state_a8fd757a8c9b92a4387c37657644498cf}
Continuously runs if the state is not done yet. \hypertarget{class_state_a29e67195da90c4c44e0e8f0fbe938c7c}{
\index{State@{State}!HandlePeriodic@{HandlePeriodic}}
\index{HandlePeriodic@{HandlePeriodic}!State@{State}}
\subsubsection[{HandlePeriodic}]{\setlength{\rightskip}{0pt plus 5cm}void State::HandlePeriodic (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}protected, virtual\mbox{]}}}}
\label{class_state_a29e67195da90c4c44e0e8f0fbe938c7c}
Periodicly runs if the state is not done yet. \hypertarget{class_state_affc91f3b2042c17937831e72987c18c4}{
\index{State@{State}!RemoveTransition@{RemoveTransition}}
\index{RemoveTransition@{RemoveTransition}!State@{State}}
\subsubsection[{RemoveTransition}]{\setlength{\rightskip}{0pt plus 5cm}void State::RemoveTransition (
\begin{DoxyParamCaption}
\item[{{\bf StateDoneCode}}]{doneCode}
\end{DoxyParamCaption}
)}}
\label{class_state_affc91f3b2042c17937831e72987c18c4}
Removes the transition with the specified \hyperlink{class_state_done_code}{StateDoneCode}.


\begin{DoxyParams}{Parameters}
{\em doneCode} & The DoneCode of the transition. \\
\hline
\end{DoxyParams}
\hypertarget{class_state_afc24d1a3d56c4d41fe85329e372f2146}{
\index{State@{State}!SetDoneCode@{SetDoneCode}}
\index{SetDoneCode@{SetDoneCode}!State@{State}}
\subsubsection[{SetDoneCode}]{\setlength{\rightskip}{0pt plus 5cm}void State::SetDoneCode (
\begin{DoxyParamCaption}
\item[{{\bf StateDoneCode}}]{doneCode}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{class_state_afc24d1a3d56c4d41fe85329e372f2146}
Sets the State's \hyperlink{class_state_done_code}{StateDoneCode}, thereby finishing the \hyperlink{class_state}{State}.


\begin{DoxyParams}{Parameters}
{\em doneCode} & The \hyperlink{class_state_done_code}{StateDoneCode}. \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
C:/Documents and Settings/Sam/My Documents/My Projects/Entech-\/Fpk/Entech-\/Fpk/State.hpp\item 
C:/Documents and Settings/Sam/My Documents/My Projects/Entech-\/Fpk/Entech-\/Fpk/State.cpp\end{DoxyCompactItemize}
